import http from ".."

enum Api {
    articleSortUrl = '/api/sort/backstage/article/',
    articleUrl = '/api/article/backstage/'
}


// 获取所有的文章分类列表
export async function getArticleSortApi() {
    return await http.get(Api.articleSortUrl)
}
// 添加文章分类
export async function postArticleSortApi(parms: any) {
    return await http.post(Api.articleSortUrl, parms)
}
// 修改文章分类
export async function putArticleSortApi(id: string | number, parms: any) {
    return await http.put(Api.articleSortUrl, id, parms)
}
// 删除文章分类
export async function delArticleSortApi(id: string | number) {
    return await http.delete(Api.articleSortUrl, id)
}

// 获取所有的文章列表
export async function getArticleApi(parms) {
    return await http.get(Api.articleUrl, parms)
}
// 获取文章详情
export async function getArticleDetailsApi(id: number) {
    return await http.getRestApi(Api.articleUrl, id)
}
// 添加文章
export async function postArticleApi(parms: any) {
    return await http.post(Api.articleUrl, parms)
}
// 修改文章
export async function putArticleApi(id: string | number, parms: any) {
    return await http.put(Api.articleUrl, id, parms)
}
// 删除文章
export async function delArticleApi(id: string | number) {
    return await http.delete(Api.articleUrl, id)
}

